{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Lesson-01 Assignment"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 今天是2020年1月05日，今天世界上又多了一名AI工程师 :) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`各位同学大家好，欢迎各位开始学习我们的人工智能课程。这门课程假设大家不具备机器学习和人工智能的知识，但是希望大家具备初级的Python编程能力。根据往期同学的实际反馈，我们课程的完结之后 能力能够超过80%的计算机人工智能/深度学习方向的硕士生的能力。`"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 本次作业的内容"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1. 复现课堂代码\n",
    "\n",
    "在本部分，你需要参照我们给大家的GitHub地址里边的课堂代码，结合课堂内容，复现内容。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2. 作业截止时间\n",
    "此次作业截止时间为 2020.01.12日"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3. 完成以下问答和编程练习"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 基础理论部分"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "> **评阅点**：每道题是否回答完整"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 0. Can you come up out 3 sceneraies which use AI methods? "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ans: \n",
    "1. 无人超市\n",
    "2. 智能医疗\n",
    "3. 自动驾驶\n",
    "4. 智能客服\n",
    "5. 新闻推荐\n",
    "6. 人工智能养猪"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1. How do we use Github; Why do we use Jupyter and Pycharm;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ans:\n",
    "1. 一般常用的是git commit: 提交代码； git pull: 更新代码； git clone: 远程下拉项目到本地；rm -rf  .git：删除本地仓库\n",
    "2. jupyter和pycharm各有优点，jupyter是一种网页工具，方便操作，安装简单，有强大的兼容性和可视化性，可以查看每一段代码的输出与运行效果。pycharm则是目前使用非常广泛的一种适用于python编程语言的集成开发环境，功能强大， 包含编码补全，项目代码导航，代码分析，集成版本控制等，可以大大提高我们平时的开发编程效率。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2. What's the Probability Model?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ans:\n",
    "1. 概率分布函数或密度函数的集合\n",
    "2. 可分为参数模型，无参数和半参数模型"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3. Can you came up with some sceneraies at which we could use Probability Model?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ans:\n",
    "1. 天气预报\n",
    "2. 股票行情分析预测\n",
    "3. 广告投放\n",
    "4. 车辆监控"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 4. Why do we use probability and what's the difficult points for programming based on parsing and pattern match?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ans:\n",
    "1. 使用概率，是因为AI很多模型，处理的问题，变量都具有不确定性和随机性\n",
    "2. 包括被建模系统内在的随机性；不完全观测以及不完全建模等。\n",
    "3. 很多基本机器学习内容，包括马尔可夫，贝叶斯等基础都是概率模型"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 5. What's the Language Model;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ans:\n",
    "1. 从机器学习的角度来讲， 语言模型是指对于语句的概率分布的建模\n",
    "2. 白话来讲， 就是判断一个语句序列是不是“人话”\n",
    "3. 核心：条件概率， 目的就是求解语句序列的概率"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 6. Can you came up with some sceneraies at which we could use Language Model?\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ans:\n",
    "1. 错误检测纠正，使用语言模型判断句子是否合理\n",
    "2. 输入法输入是否正确\n",
    "3. 语音识别，判断识别结果是否合理\n",
    "4. 机器翻译\n",
    "5. 自动补全"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 7. What's the 1-gram language model;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ans:\n",
    "1. 计算语言模型中引入了马尔可夫假设，即，随意一个词出现的概率只与它前面出现的有限的一个或者几个词有关。\n",
    "2. 1-gram则就是指，一个词出现的概率和它周围出现的概率是独立的，即：\n",
    "$$ P(sentence) = p(w_1)*p(w_2)*p(w_3)*...*p(w_n) $$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 8. What's the disadvantages and advantages of 1-gram language model;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ans:\n",
    "1. 优点： 计算空间，时间要求少；计算，操作方便简单\n",
    "2. 缺点： 一元模型，是假设每个词都是条件无关的，导致考虑不到词与词之间的关系搭配，不能很准确的表达语言合理的概率"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 9. What't the 2-gram models;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Ans:\n",
    "1. 2-gram模型，是指一个词出现依赖与它的前一个词\n",
    "2. 公式如下：\n",
    "$$ P(sentence) = p(w_1)*p(w_2|w_1)*p(w_3|w_2)*...*p(w_n|w_{n-1}) $$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
